(function () {
    var EVENT_CLICK = Laya.Event.CLICK;
    var io = ppt.io;

    function roleDetails() {
        roleDetails.super(this);
        this.roleup = null;
        this.roletitle = null;
        this.roleskill = null;
        this.type = null;
        this.data = null;
        this.skillNub = 1;
        this.init();
    }
    Laya.class(roleDetails, "Com.Role.Details", ui.Role.RoleDetailsUI);
    var _proto = roleDetails.prototype;

    _proto.init = function () {
        this.createUI();
    }

    _proto.createUI = function () {
        var roletitle = new Com.Role.Title();
        roletitle.y = 100;
        this.roletitle = roletitle;
        var roleup = new Com.Role.Up(function () {
           this.roleskill.skillUp(this.type);
        }.bind(this));
        this.roleup = roleup;
        roleup.y = 330;
        roleup.x = 10;
        var roleskill = new Com.Role.Skill(function (type) {
           this.roleup.upData(this.data,type);
           this.type = type;
        }.bind(this));
        roleskill.y = 250;
        roleskill.x = 20;
        this.roleskill = roleskill;
        this.addChildren(roleskill, roletitle, roleup);
    }
    _proto.detailData = function (data, type) {
        this.roleName.text = data.name;
        this.data = data;
        if(this.skillNub == 1){
            this.skillNub++;
            this.roleup.upData(data,0);
            this.roletitle.titleData(data, type);
            this.roleskill.skillPhoto(data);
        }
    }
    _proto.skillAll = function (starLength,skillNum,chipNum) {
        this.roletitle.skillTitle(starLength,chipNum);
        this.roleskill.skillNum(skillNum);
    }
    _proto.allSkillData = function (data) {
        this.roleup.upgradeData(data);
    }
})();